package com.zts.modules.sys.entity.model;

import com.zts.base.entity.EntityModel;
import com.zts.modules.sys.entity.User;
import com.zts.util.BeanUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import org.springframework.beans.BeanUtils;


import java.util.Date;

/**
 * Created by Zhangkh on 2017/6/2.
 */
@ApiModel
public class UserModel extends EntityModel<User> {
    @ApiModelProperty(value = "登录名标识")
    private String loginName;          //登录名
    @ApiModelProperty(value = "用户姓名")
    private String userName;
    @ApiModelProperty(value = "密码")
    private String password;
    @ApiModelProperty(value = "用户状态，0：不可用，1：可用")
    private String status;
    @ApiModelProperty(value = "用户类型，1：普通用户")
    private String type;
    @ApiModelProperty(value = "性别，1：男性，2：女性")
    private String sex;
    //private String grade;
    @ApiModelProperty(value = "手机号码")
    private String mobile;
    private String mobileShort;
    @ApiModelProperty(value = "办公电话")
    private String phone;
    private String phoneShort;

    @ApiModelProperty(value = "邮箱")
    private String email;
    @ApiModelProperty(value = "身份证号码")
    private String idcard;
    private String remark;

    private Long groupId;


    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }



    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getMobileShort() {
        return mobileShort;
    }

    public void setMobileShort(String mobileShort) {
        this.mobileShort = mobileShort;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPhoneShort() {
        return phoneShort;
    }

    public void setPhoneShort(String phoneShort) {
        this.phoneShort = phoneShort;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getIdcard() {
        return idcard;
    }

    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public Long getGroupId() {
        return groupId;
    }

    public void setGroupId(Long groupId) {
        this.groupId = groupId;
    }

    @Override
    public User transEntity()
    {
        User user = new User();
        String[] emptyProperties = BeanUtil.getNullPropertyNames(this);
        BeanUtils.copyProperties(this, user, emptyProperties);
        return user;
    }

    @Override
    public User transEntity(User user)
    {
        String[] emptyProperties = BeanUtil.getNullPropertyNames(this);
        BeanUtils.copyProperties(this, user, emptyProperties);
        return user;
    }
}
